import request from '@/utils/request'

// 创建考试记录
export function createExaminationRecord(data) {
  return request({
    url: '/exam/examination-record/create',
    method: 'post',
    data: data
  })
}

// 更新考试记录
export function updateExaminationRecord(data) {
  return request({
    url: '/exam/examination-record/update',
    method: 'put',
    data: data
  })
}

// 删除考试记录
export function deleteExaminationRecord(id) {
  return request({
    url: '/exam/examination-record/delete?id=' + id,
    method: 'delete'
  })
}

// 获得考试记录
export function getExaminationRecord(id) {
  return request({
    url: '/exam/examination-record/get?id=' + id,
    method: 'get'
  })
}

// 获得考试记录分页
export function getExaminationRecordPage(query) {
  return request({
    url: '/exam/examination-record/page',
    method: 'get',
    params: query
  })
}

// 导出考试记录 Excel
export function exportExaminationRecordExcel(query) {
  return request({
    url: '/exam/examination-record/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 获得考试记录
export function getExaminationRecordDetail(query) {
  return request({
    url: '/exam/examination-record/get',
    method: 'get',
    params: query
  })
}

//批改完成
export function completeMarking (obj) {
  return request({
    url: '/exam/examination-record/completeMarking',
    method: 'put',
    data: obj
  })
}

